import java.util.ArrayList;

public class CompanieAssure {
	private String nomme;
	private int noClients;
	public ArrayList<Personne> clients;

	public CompanieAssure() {

	}

	public CompanieAssure(String nomme) {
		this.nomme = nomme;
		clients = new ArrayList<Personne>();
	}

	public String getNomme() {
		return nomme;
	}

	public void setNomme(String nomme) {
		this.nomme = nomme;

	}
	
	
	public void addClients(Personne pers) {
		clients.add(pers);
	}

	public boolean isClientEmpty() {
		if (clients.isEmpty()) {
			return true;
		}

		return false;
	}

	public boolean existClient(Personne pers) {
		if (clients.contains(pers)) {
			return true;
		} 
			return false;
	}

	public void setAllClients( ArrayList<Personne> pers) 
	 {
		clients.addAll(pers);
	}

	public void removeClient(Personne pers) 
	{
		clients.remove(pers);
	}
	public void removeCient()
	{
		clients.clear();
	}
	
	public void removeClient(int i)
	{
	 clients.remove(i);
	}
	
	void setClient(int i, Personne pers)
	{
		clients.set(i, pers);
	}
	
	public void insertClient(int i, Personne pers)
	{
		clients.add(i, pers);
	}
	
	public ArrayList<Personne> getAllClients() 
	{
		return clients;
	}
	
	public Personne getClient(int i) 
	
	{
		return clients.get(i);
	}
	
	public int getNbOfClients()
	{
		noClients= clients.size();
		return noClients;
	}
	
	public void display()
	{
		System.out.println("Numarul de persoane din lista:"+clients.size());
		System.out.println("Afisam persoanele:");
		for (Personne p : clients) {
			System.out.println("Nume:"+p.getNomme());
			System.out.println("NoMasini:"+p.getNoOfVoitureAssure());
		}
		
	}
	
}
